package com.github.vortexdev.yachtclub.models;

import java.util.Date;
import java.util.LinkedList;
import java.util.List;

/**
 * @author Sergey Parakhin (sergey.parahin@gmail.com)
 */
public class Regatta {
    private int regattaId;
    private String name;
    private String country;
    private String city;
    private Date regattaDate;
    private List<Yacht> yachts = new LinkedList<Yacht>();

    public Regatta() {}

    public Regatta(int id) {
        this.regattaId = id;
    }

    public int getRegattaId() {
        return regattaId;
    }

    public void setRegattaId(int id) {
        this.regattaId = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getRegattaDate() {
        return regattaDate;
    }

    public void setRegattaDate(Date regattaDate) {
        this.regattaDate = regattaDate;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public List<Yacht> getYachts() {
        return yachts;
    }

    public void addYacht(Yacht yacht) {
        yachts.add(yacht);
        yacht.getRegattas().add(this);
    }
}
